package com.yegs.jltqc.controller;

import com.yegs.jltqc.TO.NamePageQuery;
import com.yegs.jltqc.VO.WorkFlow;
import com.yegs.jltqc.VO.WorkFlowResult;
import com.yegs.jltqc.config.Msg;
import com.yegs.jltqc.service.WorkFlowResultService;
import com.yegs.jltqc.service.WorkFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/workflowresult")
public class WorkFlowResultController {

    @Autowired
    private WorkFlowResultService workFlowResultService;

    @PostMapping("/save")
    public Msg save(@RequestBody WorkFlowResult workFlowResult){
        try{
            return Msg.success("data", workFlowResultService.save(workFlowResult));
        }catch (Exception e){
            return Msg.error(e.getMessage());
        }
    }

    @GetMapping("/list")
    public Msg list(){
        return Msg.success("list",workFlowResultService.list());
    }


}
